#include <stdio.h>
#define N 5
int main() {
    int a[N][N], i, j, sum1 = 0, sum2 = 0;
    printf("输入%d*%d矩阵:\n", N, N);
    for (i = 0; i < N; i++) {
        for (j = 0; j < N; j++) {
            scanf("%d", &a[i][j]);
        }
    }
    for (i = 0; i < N; i++) {
        sum1 += a[i][i];
        sum2 += a[i][N - 1 - i];
    }
    printf("主对角线和：%d\n副对角线和:%d\n", sum1, sum2);
    return 0;
}